package cn.edu.neusoft.model.mapper;

import cn.edu.neusoft.model.bean.CarIO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface CarIOMapper {
    // 插入新记录的方法
    @Insert("INSERT INTO car_io (id, dev_id, dev_chn_id, dev_chn_num, dev_name, " +
            "parking_car_color_str, dev_chn_name, car_num, car_num_color, car_num_color_str, " +
            "car_type, car_type_str, car_color, car_direct, car_direct_str, car_way_code, " +
            "cap_time, car_brand, car_img_url, car_num_pic, rec_stat, save_flag, dc_clean_flag, " +
            "car_inner_category, strobe_state, cap_time_str, car_color_str, real_capture_pic_path, " +
            "original_pic_path, parking_lot_code, parking_lot, parking_lot_like_str, owner_name, " +
            "owner_code, owner_id, parking_car_color, parking_car_logo, parking_car_type, " +
            "department_id, name, department_name, tide_name, car_license_plate_type, " +
            "car_license_plate_type_str) " +
            "VALUES (#{id}, #{devId}, #{devChnId}, #{devChnNum}, #{devName}, " +
            "#{parkingCarColorStr}, #{devChnName}, #{carNum}, #{carNumColor}, #{carNumColorStr}, " +
            "#{carType}, #{carTypeStr}, #{carColor}, #{carDirect}, #{carDirectStr}, #{carWayCode}, " +
            "#{capTime}, #{carBrand}, #{carImgUrl}, #{carNumPic}, #{recStat}, #{saveFlag}, #{dcCleanFlag}, " +
            "#{carInnerCategory}, #{strobeState}, #{capTimeStr}, #{carColorStr}, #{realCapturePicPath}, " +
            "#{originalPicPath}, #{parkingLotCode}, #{parkingLot}, #{parkingLotLikeStr}, #{ownerName}, " +
            "#{ownerCode}, #{ownerId}, #{parkingCarColor}, #{parkingCarLogo}, #{parkingCarType}, " +
            "#{departmentId}, #{name}, #{departmentName}, #{tideName}, #{carLicensePlateType}, " +
            "#{carLicensePlateTypeStr})")
    int insertCarIo(CarIO carIo);

    // 清空表的方法
    @Delete("TRUNCATE TABLE car_io")
    int clearCarIoTable();
}
